D:\git\skunkworks\herald-for-cpp\herald\include\herald\data\payload_data_formatter.h
Line | Count | Source |
1 | | // Copyright 2021 Herald Project Contributors |
2 | | // SPDX-License-Identifier: Apache-2.0 |
3 | | // |
4 | | |
5 | | #ifndef HERALD_PAYLOAD_DATA_FORMATTER_H |
6 | | #define HERALD_PAYLOAD_DATA_FORMATTER_H |
7 | | |
8 | | #include "../datatype/payload_data.h" |
9 | | |
10 | | #include <string> |
11 | | |
12 | | namespace herald::data { |
13 | | |
14 | | using namespace herald::datatype; |
15 | | |
16 | | class PayloadDataFormatter { |
17 | | public: |
18 | 1 | PayloadDataFormatter() = default; |
19 | 1 | virtual ~PayloadDataFormatter() = default; |
20 | | |
21 | | virtual std::string shortFormat(const PayloadData& payloadData) const noexcept = 0; |
22 | | }; |
23 | | |
24 | | class ConcretePayloadDataFormatter : public PayloadDataFormatter { |
25 | | public: |
26 | 1 | ConcretePayloadDataFormatter() = default; |
27 | 1 | ~ConcretePayloadDataFormatter() = default; |
28 | | |
29 | | std::string shortFormat(const PayloadData& payloadData) const noexcept override; |
30 | | }; |
31 | | |
32 | | } |
33 | | |
34 | | #endif |